home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb.new / gdb-3.98 / bfd.mips / ecoff.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-23  |  3.8 KB  |  101 lines

  1. /* MIPS Extended-Coff back-end for BFD.
  2.    Copyright (C) 1990-1991 Free Software Foundation, Inc.
  3.    Written by Per Bothner.
  4.  
  5. This file is part of BFD, the Binary File Descriptor library.
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21. #include <sysdep.h>
  22. #define MIPS 1
  23. #include "bfd.h"
  24. #include "libbfd.h"
  25.  
  26. #include "ecoff.h"
  27. #include "internalcoff.h"
  28. #include "libcoff.h"        /* to allow easier abstraction-breaking */
  29.  
  30. #define BADMAG(x) ECOFFBADMAG(x)
  31.  
  32. /* Define NO_COFF_SYMBOLS and NO_COFF_LINENOS to avoid coffcode.h
  33.    defining a mess of useless functions.  */
  34. #define    NO_COFF_SYMBOLS
  35. #define    NO_COFF_LINENOS
  36. #include "coffcode.h"
  37.  
  38. /* We do not implement symbols for ecoff. */
  39. #define    coff_get_symtab_upper_bound (PROTO(unsigned int, (*),(bfd *)))bfd_false
  40. #define    coff_get_symtab     (PROTO(unsigned int, (*), (bfd *, asymbol **)))bfd_0
  41. #define coff_print_symbol \
  42.     (PROTO(void,(*),(bfd *, PTR, asymbol *, enum bfd_print_symbol))) bfd_void
  43. #define    coff_swap_sym_in (PROTO(void,(*),(bfd *,PTR,PTR))) bfd_void
  44. #define    coff_swap_aux_in (PROTO(void,(*),(bfd *,PTR,PTR))) bfd_void
  45.  
  46. /* We do not implement linenos for ecoff. */
  47. #define coff_get_lineno (struct lineno_cache_entry *(*)()) bfd_nullvoidptr
  48. #define    coff_swap_lineno_in (PROTO(void,(*),(bfd *,PTR,PTR))) bfd_void
  49. #define coff_find_nearest_line (PROTO(boolean, (*),(bfd*,asection*,asymbol**,bfd_vma, CONST char**, CONST char**, unsigned int *))) bfd_false
  50.  
  51. bfd_target ecoff_little_vec =
  52.     {"ecoff-littlemips",      /* name */
  53.     bfd_target_coff_flavour_enum,
  54.     false,            /* data byte order is little */
  55.     false,            /* header byte order is little */
  56.  
  57.     (HAS_RELOC | EXEC_P |    /* object flags */
  58.      HAS_LINENO | HAS_DEBUG |
  59.      HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT),
  60.  
  61.     (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */
  62.     '/',            /* ar_pad_char */
  63.     15,            /* ar_max_namelen */
  64.        3,            /* minimum alignment power */
  65. _do_getl64, _do_putl64,    _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */
  66. _do_getl64, _do_putl64,    _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */
  67.  
  68.     {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
  69.       bfd_generic_archive_p, _bfd_dummy_target},
  70.     {bfd_false, coff_mkobject, bfd_false, /* bfd_set_format */
  71.       bfd_false},
  72.     {bfd_false, coff_write_object_contents, bfd_false, bfd_false},
  73.     JUMP_TABLE (coff)
  74. };
  75.  
  76. bfd_target ecoff_big_vec =
  77.     {"ecoff-bigmips",      /* name */
  78.     bfd_target_coff_flavour_enum,
  79.     true,            /* data byte order is big */
  80.     true,            /* header byte order is big */
  81.  
  82.     (HAS_RELOC | EXEC_P |    /* object flags */
  83.      HAS_LINENO | HAS_DEBUG |
  84.      HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT),
  85.  
  86.     (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */
  87.     ' ',            /* ar_pad_char */
  88.     16,            /* ar_max_namelen */
  89.        3,            /* minimum alignment power */
  90. _do_getb64, _do_putb64,    _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */
  91. _do_getb64, _do_putb64,    _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */
  92.     {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
  93.       bfd_generic_archive_p, _bfd_dummy_target},
  94.     {bfd_false, coff_mkobject, bfd_false, /* bfd_set_format */
  95.       bfd_false},
  96.     {bfd_false, coff_write_object_contents, /* bfd_write_contents */
  97.       bfd_false, bfd_false},
  98.     JUMP_TABLE(coff),
  99.       COFF_SWAP_TABLE
  100. };
  101.